package logic

import (
	"ViewSrv/global/model"
	"ViewSrv/internal/svc"
	"ViewSrv/view"
	"context"

	"github.com/zeromicro/go-zero/core/logx"
)

type ClassesLikeLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewClassesLikeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ClassesLikeLogic {
	return &ClassesLikeLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ClassesLikeLogic) ClassesLike(in *view.ClassesLikeRequest) (*view.ClassesLikeResponse, error) {
	// todo: add your logic here and delete this line
	var ClassesLike = model.ClassesLike{
		ClassesId: int(in.ClassesId),
		UserId:    int(in.UserId),
	}
	model.DB.Create(&ClassesLike)
	return &view.ClassesLikeResponse{}, nil
}
